package polymorphism.music3;
import static net.mindview.util.Print.*;

import polymorphism.music.Node;

class Instrument{
	void play(Node n){
		print("Instrument.play()" + n);
	}
	String what(){
		return "Instrument";
	}
	void adujst(){
		print("Adujstingn Instrument");
	}
}
class Wind extends Instrument{
	void play(Node n){
		print("Wind.play()" + n);
	}
	String what(){
		return "Wind";
	}
	void adujst(){
		print("Adujstingn Wind");
	}
}
class Percussion extends Instrument{
	void play(Node n){
		print("Percussion.play()" + n);
	}
	String what(){
		return "Percussion";
	}
	void adujst(){
		print("Adujstingn Percussion");
	}
}
class Stringed extends Instrument{
	void play(Node n){
		print("Stringed.play()" + n);
	}
	String what(){
		return "Stringed";
	}
	void adujst(){
		print("Adujstingn Stringed");
	}
}
class Brass extends Instrument{
	void play(Node n){
		print("Brass.play()" + n);
	}
	void adujst(){
		print("Adujstingn Brass");
	}
}
class Woodwind extends Instrument{
	void play(Node n){
		print("Woodwind.play()" + n);
	}
	String what(){
		return "Woodwind";
	}
	
}
public class Music3 {
   public static void tune(Instrument i){
	   i.play(Node.MIDDLE_C);
   }
   public static void tuneAll(Instrument[] e) {
	   for (Instrument i : e) 
	     tune(i);
   }
   public static void main(String[] args) {
	 Instrument[] orchestra = {
			 new Wind(),
			 new Percussion(),
			 new Stringed(),
			 new Brass(),
			 new Woodwind()
	 };
	 tuneAll(orchestra);
   }
}
